package com.wlyuan.open.domain.api.respository;

import com.wlyuan.core.domain.repository.BaseRepository;
import com.wlyuan.open.domain.api.OpenApiInfo;
import com.wlyuan.open.domain.api.valueobj.OpenApiId;
import com.wlyuan.open.domain.api.valueobj.OpenApiInfoId;
import com.wlyuan.open.domain.client.OpenClientId;
import com.wlyuan.open.dto.api.OpenApiCompanyFilterDTO;
import com.wlyuan.utils.Page;

import java.util.List;

/**
 * @author yuanzheng
 */
public interface OpenApiInfoRepository extends BaseRepository<OpenApiInfo, OpenApiInfoId> {

    /**
     * 根据 客户端id 和 接口id查询
     *
     * @param openClientId
     * @param openApiId
     * @return
     */
    OpenApiInfo getByClientIdAndApiId(OpenClientId openClientId, OpenApiId openApiId);

    /**
     * 根据客户端id查询
     *
     * @param clientId
     * @return
     */
    List<OpenApiInfo> getByClientId(OpenClientId clientId);

    /**
     * 获取申请接口列表
     *
     * @param filter
     * @return
     */
    Page<OpenApiInfoId> search(OpenApiCompanyFilterDTO filter);

    void removeByClient(OpenClientId openClientId);

}
